import { ClientOpcode } from "@runtime/generate/message/ClientOpcode";
import DiagnosisDisplayMessageHandler from "@runtime/module/Handler/DiagnosisDisplayMessage";
import DiagnosisUnityMessageHandler from "@runtime/module/Handler/UnityMessageHandler";
import WebSocketComponent from "@runtime/module/WebSocket/WebSocketComponent";


export default class ClientMessageHandlerLoader {
  private static instance: ClientMessageHandlerLoader = new ClientMessageHandlerLoader();
  /**
   * 请求处理加载器
   */
  public static get Default(): ClientMessageHandlerLoader {
    return this.instance;
  }

  public Load(): void {
    WebSocketComponent.Default.Register(ClientOpcode.DiagnosisUnityMessage, new DiagnosisUnityMessageHandler());
    WebSocketComponent.Default.Register(ClientOpcode.DiagnosisDisplayMessage, new DiagnosisDisplayMessageHandler());
  }
}